package com.wanmait.happyheating.controller;

import com.wanmait.happyheating.pojo.MaterialsPrice;
import com.wanmait.happyheating.service.MaterialsPriceService;
import com.wanmait.happyheating.util.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/*
          耗材最新价格的Controller
          @author 明康
 */
@RestController
@RequestMapping("/manage")
public class AdminMaterialsPriceController {

    @Resource
    private MaterialsPriceService materialsPriceService;

    @RequestMapping("addNewMaterialsPrice")
    public Result addNewMaterialsPrice(@RequestBody MaterialsPrice materialsPrice){
        Boolean flag = materialsPriceService.save(materialsPrice);
        if(flag){
            return Result.success("添加成功！");
        }else{
            return Result.error("添加失败!");
        }

    }
}
